package cn.tude.cn.tedu.Test033_99chengfa;

public class a {
    public static void main(String[] args) {

        long star = System.currentTimeMillis();
        m(9);
        long end = System.currentTimeMillis();
        System.out.println(end - star);
        System.out.println();
        long star1 = System.currentTimeMillis();
        m2(1);
        long end1 = System.currentTimeMillis();
        System.out.println(end1 - star1);
        System.out.println();
    }

    /**
     * 打印出九九乘法表
     *
     * @param i
     */
    public static void m(int i) {

        if (i == 1) {
            // System.out.println("1*1=1 ");
        } else {
            m(i - 1);
            for (int j = 1; j <= i; j++) {
                System.out.print(j + "*" + i + "=" + j * i + "  ");
            }
            System.out.println();

        }
    }

       public static  void m2(int i){

        if(i<10&&i>0){
            for (int j = 1; j <= i; j++) {
                System.out.print(j+"*"+i+"="+j*i+"  ");
            }  System.out.println(  );
             m2(i+1);
        }



       }
    }




